<template>
	<view>
		<view class="center">
			<!-- 功能模块 -->
			<view class="function">
				<view class="tit">信息管理</view>
				<view class="function_four pack">
					<view class="manage" @click="vehicleClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-CL.png')" :size="80" class="mar">
						</u-icon>
						<view class="grid-text">车辆信息</view>
					</view>
					<view class="manage" @click="masgClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-SFZXX.png')" :size="76" class="mar">
						</u-icon>
						<view class="grid-text">个人信息</view>
					</view>
					<view class="manage" @click="addresAdmin">
						<view class="iconfont iconweizhi" style="font-size:55rpx;color: #0197F8;">
						</view>
						<view class="manage-text">收货地址</view>
					</view>
					<view class="manage" @click="userfpclick">
						<image style="width:50rpx; height: 60rpx;" class="iconfont"
							:src="getStaticFilePath('/home/nav/nav-FP.png')"></image>
						<view class="manage-text" style="margin: 0;">
							出货单补打
						</view>
					</view>
					<view class="manage" v-if="userinfo.sign == 'CUS-1'" @click="customerManagementClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-KH.png')" :size="80" class="mar">
						</u-icon>
						<view class="grid-text">客户信息</view>
					</view>
				</view>
			</view>

			<view class="function">
				<view class="tit">订单信息</view>
				<view class="function_four pack">
					<view class="manage" @click="hyClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-infoList.png')" style="margin-top: -3rpx;"
							:size="65" class="mar">
						</u-icon>
						<view class="grid-text" style="margin-top: 5rpx;">配送信息</view>
					</view>
					<view class="manage" @click="fdClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-FDJL.png')" :size="80" class="mar">
						</u-icon>
						<view class="grid-text">发单记录</view>
					</view>
					<view class="manage" @click="freightRecordClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-YF.png')" :size="80" class="mar">
						</u-icon>
						<view class="grid-text">配送记录</view>
					</view>
					<view class="manage" v-if="userinfo.ORMTB410CB06 == '1'" @click="ksdxdClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-DXD.png')" :size="80" class="mar">
						</u-icon>
						<view class="grid-text">代下单</view>
					</view>
				</view>
			</view>

			<view class="function">
				<view class="tit">用户服务</view>
				<view class="function_four pack">
					<!-- <view class="manage" v-if="AuthorizationOBJ.ORMTB417CA06 != 0" @click="QRClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-QR.png')" :size="80" class="mar">
						</u-icon>
						<view class="grid-text">扫一扫</view>
					</view> -->
					<view class="manage" v-if="AuthorizationOBJ.ORMTB417CA06 != 0" @click="dpBjClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-DP.png')" :size="80" class="mar">
						</u-icon>
						<view class="grid-text">单品比价</view>
					</view>
					<view class="manage" @click="priceClick">
						<u-icon :name="getStaticFilePath('/home/nav/nav-BD.png')" :size="80" class="mar">
						</u-icon>
						<view class="grid-text">价格比对</view>
					</view>
					<view class="manage" @click="searchTGclick">
						<u-icon style="width:68rpx; height: 65rpx;" class="iconfont"
							:name="getStaticFilePath('/home/nav/nav-LX.png')"></u-icon>
						<view class="manage-text">我要推广</view>
					</view>
					<view class="manage" @click="searchTGMXclick">
						<u-icon style="width:68rpx; height: 65rpx;" class="iconfont"
							:name="getStaticFilePath('/home/nav/nav-TGMX.png')"></u-icon>
						<view class="manage-text">推广明细</view>
					</view>
					<view class="manage" @click="ewmClick">
						<u-icon style="width:86rpx; height: 86rpx;" class="iconfont"
							:name="getStaticFilePath('/home/nav/nav-ewmicon.png')"></u-icon>
						<view class="manage-text">提货码</view>
					</view>
					<view class="manage" v-if="AuthorizationOBJ.ORMTB417CA06 != 0" @click="zpcjClick">
						<u-icon style="width:68rpx; height: 65rpx;" class="iconfont"
							:name="getStaticFilePath('/home/nav/nav-CJ.png')"></u-icon>
						<view class="manage-text">每日抽奖</view>
					</view>
					<view class="manage" v-if="AuthorizationOBJ.ORMTB417CA06 != 0" @click="YHClick">
						<u-icon style="width:80rpx; height: 73rpx;" class="iconfont"
							:name="getStaticFilePath('/home/nav/nav-YH.png')"></u-icon>
						<view class="manage-text">优惠政策</view>
					</view>
				</view>
			</view>
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
export default {
	data() {
		return {
			userinfo: JSON.parse(uni.getStorageSync('userinfo')),
			userinfoCusName: '',
			userinfoPhone: '',
			outLoginShow: false,
			AuthorizationOBJ: '',
		}
	},
	onShow() {
		if (this.userinfo.sign == 'CUS-3') {
			this.queryAuthorization()
		}
	},
	methods: {
		customerManagementClick() {
			uni.navigateTo({
				url: '../../customerManagement/index'
			})
		},
		ksdxdClick() {
			uni.navigateTo({
				url: '/pages/daiOrde/ksdaiOrde/index'
			})
		},
		dpBjClick() {
			uni.navigateTo({
				url: '/pages/dpBj/index'
			})
		},
		vehicleClick() {
			uni.navigateTo({
				url: '../../vehicle/index'
			})
		},
		masgClick() {
			uni.navigateTo({
				url: '/pages/wallet/userMase/index'
			})
		},
		hyClick() {
			uni.navigateTo({
				url: '../../masgList/index'
			})
		},
		fdClick() {
			uni.navigateTo({
				url: '/pages/daiOrde/fdjl/index'
			})
		},
		freightRecordClick() {
			uni.navigateTo({
				url: '/pages/yunfeiMaseg/wdyfdd/index'
			})
		},
		priceClick() {
			uni.navigateTo({
				url: '/pages/priceComparison/index'
			})
		},
		queryAuthorization() { //查询子账户权限
			uni.showLoading({
				title: '加载中...',
				mask: true
			});
			uni.request({
				url: this.baseUrl + '/orm/ormtb417/selectAccess/' + this.userinfo.ORMTB417ID,
				method: 'GET',
				success: (res) => {
					uni.hideLoading();
					if (res.data.code == 200) {
						this.AuthorizationOBJ = res.data.data
					} else {
						this.$refs.uToast.show({
							title: res.data.message,
							type: 'default',
							icon: false
						})
					}
				},
				fail: (res) => {
					uni.hideLoading();
					this.$refs.uToast.show({
						title: '服务器连接超时',
						type: 'default',
						icon: false
					})
				}
			});
		},
		zpcjClick() {
			uni.navigateTo({
				url: '/pages/zpcjlist/index'
			})
		},
		searchTGclick() {
			uni.navigateTo({
				url: '/pages/searchTG/index'
			})
		},
		YHClick() {
			uni.navigateTo({
				url: '/pages/accountFavouredPolicy/index'
			})
		},
		searchTGMXclick() {
			uni.navigateTo({
				url: '/pages/tgmx/index'
			})
		},
		searchFuelCardclick() {
			uni.navigateTo({
				url: '/pages/fuelCard/index'
			})
		},
		ewmClick() {
			uni.navigateTo({
				url: `${'/pages/ewm/index'}`
			})
		},
		userfpclick() {
			uni.navigateTo({
				url: '/pages/shouquan/more/bill'
			})
		},
		addresAdmin() {
			uni.navigateTo({
				url: '/pages/deliveryPlace/index'
			})
		},
	}
}
</script>

<style lang="scss">
.center {
	background: #f5f1f1;
	padding: 30rpx;
	display: flex;
	position: relative;
	flex-direction: column;
	height: 100vh;
}

.function {
	background: #fff;
	padding: 0 0rpx 0rpx 15rpx;
	border-radius: 20rpx;
	margin-bottom: 20rpx;

	.tit {
		font-size: 40rpx;
		margin: 30rpx 0 50rpx;
		padding-left: 15rpx;
	}
}

.function_four {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
}

.function_four>view {
	font-size: 32rpx;
}

.manage {
	position: relative;
	margin-bottom: 30rpx;
	display: flex;
	justify-content: center;
	align-content: space-between;
	flex-wrap: wrap;
	width: 163rpx;
	height: 124rpx;

	.mar {
		margin-top: -13rpx;
	}
}

.manage-text {
	width: 100%;
	text-align: center;
}
</style>
